package com.uchedao.vehicledetection.activity;

import android.view.View;
import android.widget.TextView;

import com.uchedao.mybaselibrary.activity.BaseActivity;
import com.uchedao.vehicledetection.R;

public abstract class CJDBaseActivity extends BaseActivity {

    public void setTitle(String _title) {
        ((TextView) findViewById(R.id.tv_title_name)).setText(_title);

        setBackButton();
    }

    public String getTitleText() {
        return ((TextView) findViewById(R.id.tv_title_name)).getText().toString().trim();
    }

    public void setBackButton() {
        TextView tvBack = (TextView) findViewById(R.id.title_back);
        if (tvBack != null)
            tvBack.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    finish();
                }
            });
    }
}
